package us.wili.dev.client.jwt;

import us.wili.dev.jwt.model.IUser;

public class JwtUser implements IUser {

    public static final String USER_CERT_CATEGORY = "user.cert";
    public static final String USER_UserId_KEY = "user.userId";
    public static final String USER_PHONE_KEY = "user.phone";
    public static final String USER_HEADIMGURL_KEY = "user.headimgurl";
    public static final String User_SIID_KEY = "user.SIID";
    public static final String User_Name_KEY = "user.name";
    public static final String User_Grade_KEY = "user.grade";
    public static final String User_ID_KEY = "user.id";



    private Long userId;
    private Integer certificationCategory;
    private String phone;
    private String nickname;
    private String headimgurl;
    private String name;
    private Integer SIID;
    private Integer grade;
    private String wxOpenid;

    private Integer userType;



    private Boolean isAnonymous = true;
    private String uuid;
    private Integer channel;

    private long expiredSeconds;


    public Integer getUserType() {
        return userType;
    }

    public void setUserType(Integer userType) {
        this.userType = userType;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Integer getCertificationCategory() {
        return certificationCategory;
    }

    public void setCertificationCategory(Integer certificationCategory) {
        this.certificationCategory = certificationCategory;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getHeadimgurl() {
        return headimgurl;
    }

    public void setHeadimgurl(String headimgurl) {
        this.headimgurl = headimgurl;
    }



    public void setSIID(Integer SIID) {
        this.SIID = SIID;
    }


    @Override
    public Boolean getAnonymous() {
        return isAnonymous;
    }

    public void setAnonymous(Boolean anonymous) {
        isAnonymous = anonymous == null ? true : anonymous;
    }

    @Override
    public String getId() {
        return this.isAnonymous ? "uuid:" + this.uuid : String.format("%d:%d", this.channel, this.getUserId());
    }

    @Override
    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    @Override
    public Integer getChannel() {
        return channel;
    }

    public void setChannel(Integer channel) {
        this.channel = channel;
    }

    @Override
    public String getSubject() {
        return nickname;
    }

    @Override
    public long getExpiredSeconds() {
        return expiredSeconds;
    }

    public void setExpiredSeconds(long expiredSeconds) {
        this.expiredSeconds = expiredSeconds;
    }


    public static String getUserPhoneKey() {
        return USER_PHONE_KEY;
    }


    public static String getUserHeadimgurlKey() {
        return USER_HEADIMGURL_KEY;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static String getUser_SIID_KEY() {
        return User_SIID_KEY;
    }

    public Integer getGrade() {
        return grade;
    }

    public void setGrade(Integer grade) {
        this.grade = grade;
    }

    public Integer getSIID() {
        return SIID;
    }

    public static String getUserCertCategory() {
        return USER_CERT_CATEGORY;
    }

    public static String getUser_Name_KEY() {
        return User_Name_KEY;
    }

    public static String getUser_Grade_KEY() {
        return User_Grade_KEY;
    }

    public static String getUser_ID_KEY() {
        return User_ID_KEY;
    }

    public String getWxOpenid() {
        return wxOpenid;
    }

    public void setWxOpenid(String wxOpenid) {
        this.wxOpenid = wxOpenid;
    }

    public static String getUSER_UserId_KEY() {
        return USER_UserId_KEY;
    }
}